home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / nt / zkf102.zip / proto.bat < prev    next >
DOS Batch File  |  1995-01-04  |  2KB  |  38 lines

  1. @zkbat proto.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
  2.  
  3. msg "A big hello from proto.bat to you." gsm;
  4.  
  5. // Try running this file, proto.bat, by typing "proto", just like any
  6. // other batch file, to verify that the output appears on your screen.
  7. //
  8. // Notice that no #include directive is used above.  That's because
  9. // the zk library #include files are already compiled for zk, in
  10. // zkpch.dat.  You do need to use #include directives for other
  11. // #include files, if any, when you write your own c++ scripts.
  12. //
  13. // The msg and gsm macros are described in library.txt.  You could use
  14. // cout instead of msg but then you would have to #include "iosteam.h".
  15. //
  16. // Don't define main() when using zk, because the main code is executed
  17. // directly from the input.  Functions other than main are defined the
  18. // normal way, as are classes, etc.  Use argc and argv, as shown below,
  19. // to get the command line arguments, if any.  If argc and argv are
  20. // confusing, try running proto.bat with some arguments to see if the
  21. // output clears up your confusion.  For example try "proto me us all".
  22. //
  23. // The first line in this file, "@zkbat proto.bat", is what causes it
  24. // to get interpreted as a c++ script.  You need that in your own c++
  25. // scripts, but change the name proto to whatever your script file is
  26. // named, e.g. "@zkbat myscript.bat".  The %1 etc. indicate that it
  27. // can take arguments.  Without those, any arguments will be ignored
  28. // and will not be available via argc/argv.
  29.  
  30. void byefrom(const char *whom) {
  31.    msg "Goodbye from %s for now.",whom gsm;
  32. }
  33.  
  34. for(int i=0; i<argc; i++) {
  35.    byefrom(argv[i]);
  36. }
  37.  
  38.